import numpy as np

def sliding_window(image, window_size, step):
    h, w = image.shape[:2]
    for y in range(0, h - window_size + 1, step):
        for x in range(0, w - window_size + 1, step):
            window = image[y:y+window_size, x:x+window_size]
            yield (x, y, window)
